package gov.nist.ssd.swqb.core.search;

import com.hp.hpl.jena.rdf.model.Model;
import static gov.nist.ssd.swqb.util.Static.concat;

/**
 * Currently it doesn't work but consume a lot of time. Don't use.<br/>
 * <br/>
 * The problem is probably in SPARQL request. str method don't return anon id.
 * 
 * @author Maxime Gabut
 *
 */
@Deprecated
class AnonRegexSearch extends AbstractSelectSearch {

	public AnonRegexSearch(RegexMatchText searchText, Model model, int requestsSize) {
	  super(searchText,
	        model,
	        requestsSize,
	        varName("x"),
	        searchPattern(
	          concat(
	            "PREFIX pf: <http://jena.hpl.hp.com/ARQ/property#>",
	            "SELECT DISTINCT ?x",
	            "WHERE {",
	            "  { ?x ?a ?b . }",
	            "  UNION",
	            "  { ?a ?b ?x . }",
	            "  FILTER (isBlank(?x) && regex(str(?x), \"%1$s\"))",
	            "}"
	          )
	        )
	      );
	}
}
